﻿using MDIDemo.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DevMy.Model
{
    public class Class_ColModel
    {
        public int address;
        public double[] Temperature = new double[6];
        public double[] LocalNormalStress = new double[14];
        public StaticParamModel[] iniTemperatureWaveParamModels = new StaticParamModel[6];
        public StaticParamModel[] temperatureCalibrationParamerParamModels = new StaticParamModel[6];
        public StaticParamModel iniNormalStressWaveParamModel = null;
        public StaticParamModel normalStressCalibrationParamerParamModel = null;
        public StaticParamModel temperatureCompensateParamerParamModel = null;
        public StaticParamModel[] angleParamModels = new StaticParamModel[3];
        public StaticParamModel mbeddedEffectParamerParamModel = null;

        /// <summary>
        /// 温度：温度标定参数*（波长-初始温度波长）
        /// </summary>
        /// <param name="iniTemperatureWave"></param>
        /// <param name="temperatureCalibrationParamer"></param>
        /// <param name="waveValue"></param>
        public void GetTemperature(StaticParamModel[] iniTemperatureWave, StaticParamModel[] temperatureCalibrationParamer, double[] waveValue)
        {
            for (int i = 0; i < 6; i++)
            {
                Temperature[i] = temperatureCalibrationParamer[i].defaultValue * (waveValue[i] - iniTemperatureWave[i].defaultValue);
            }
        }
        public void GetLocalNormalStress(double[] Temperature)
        {
            for (int i = 0; i < 14; i++)
            {
                if (i == 0 || i == 7)
                    continue;
                LocalNormalStress[i] = 1;
            }
        }
    }
}
